<?php
namespace app\admin\model;
class AboutModel extends BaseModel
{
	protected $table = "xst_about";
    protected $rule = [
        'id' => '',
    ];
    protected $msg = [
        'id' => '',
    ];
	//关于我们显示
	public function index()
    {
        return $this->order('createtime desc')->paginate(10,false,['query'=>request()->param()]);
    }
	//关于我们添加
	public function add()
    {
        $content = request()->post('content');
        return $this->insert([
            'content'=>$content,
            'createtime'=>time()
        ]);
    }
	//关于我们修改
	public function edit()
    {
        $content = request()->post('content');
        $id = request()->post('id');
        return $this->where('id',$id)->update([
            'content'=>$content,
            'createtime'=>time()
        ]);
    }
	//关于我们修改前的查询
    public function getOneId($id)
    {
        return $this->where('id',$id)->find();
    }
	//关于我们删除
	 public function del()
    {
        $id=request()->post('id');
        return $this->where('id',$id)->delete();
    }
	 //关于我们删除(全选删除)
	public function dell()
    {
        $id = request()->post('id');
        return $this->where('id','in',$id)->delete();
    }
}
?>